package com.shaoshaohuo.app.entity;

import java.util.ArrayList;
import java.util.List;

import android.os.Parcel;
import android.os.Parcelable;
/**
 * 市场行情 
 * @author cao
 *
 */
public class PriceEntity extends BaseEntity implements Parcelable {

	private PriceList data;

	public PriceList getData() {
		return data;
	}

	public void setData(PriceList data) {
		this.data = data;
	}

	public static class PriceList implements Parcelable {
		private List<Price> list;

		public List<Price> getList() {
			return list;
		}

		public void setList(List<Price> list) {
			this.list = list;
		}

		@Override
		public int describeContents() {
			return 0;
		}

		@Override
		public void writeToParcel(Parcel dest, int flags) {
			dest.writeList(list);
		}

		public static final Creator<PriceList> CREATOR = new Creator<PriceList>() {

			@Override
			public PriceList createFromParcel(Parcel source) {
				PriceList entity = new PriceList();
				entity.setList(new ArrayList<Price>());
				source.readList(entity.list, Price.class.getClassLoader());
				return entity;
			}

			@Override
			public PriceList[] newArray(int size) {
				return new PriceList[size];
			}
			
		};
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeParcelable(data, flags);
	}
	
	public static final Creator<PriceEntity> CREATOR = new Creator<PriceEntity>() {

		@Override
		public PriceEntity createFromParcel(Parcel source) {
			PriceEntity entity = new PriceEntity();
			entity.setData((PriceList) source.readParcelable(PriceList.class.getClassLoader()));
			return entity;
		}

		@Override
		public PriceEntity[] newArray(int size) {
			return new PriceEntity[size];
		}
		
	};
}
